<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>请假列表 - 请销假管理系统</title>
		<%@ include file="/common/include/title.jsp"%>
	</head>
	<body>
		<%@include file="/common/include/header.jsp"%>
		
		<div class="container-fluid">
			<div class="row">
				<div class="col-sm-10 col-sm-offset-1 main">
					<h2 class="sub-header">请假单列表</h2>
					<form action="${rootpath }/back/user/leaveList.htm" method="post" class="form-inline">
						<div class="form-group">
							<label for="keyword">关键字:</label>
							<input type="text" name="keyword" value="${requestScope.keyword }" class="form-control">
							<label for="keyword">状态:</label>
							<select name="status">
								<option value="">请选择</option>
								<option value="1" ${requestScope.status == '1' ? 'selected' : ''}>通过</option>
								<option value="0" ${requestScope.status == '0' ? 'selected' : ''}>拒绝</option>
								<option value="2" ${requestScope.status == '2' ? 'selected' : ''}>审核中</option>
								<option value="3" ${requestScope.status == '3' ? 'selected' : ''}>班主任拒绝</option>
							</select>
							<label for="email">请假时间:</label>
							<input type="text" name="st" value="${requestScope.st}" readonly="true" class="form-control"
							onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" />
							--> 
							<input type="text" name="ed" value="${requestScope.ed}" readonly="true" class="form-control"
							onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" />
							<input type="submit" class="btn btn-primary" value="搜索">
							<a href="${rootpath }/back/user/leaveInsert.htm" class="btn btn-primary">填写请假单</a>
						</div>
					</form>
					<div class="table-responsive">
						<table class="table table-striped">
							<thead>
								<tr>
									<th>序号</th>
									<th>学号</th>
									<th>姓名</th>
									<th>填表时间</th>
									<th>去向</th>
									<th>开始时间</th>
									<th>结束时间</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${requestScope.leaveList }" var="leave" varStatus="stat">
									<tr>
										<td>${stat.count }</td>
										<td>${leave.user.loginName }</td>
										<td>${leave.user.name }</td>
										<td>${leave.createTime }</td>
										<td>${leave.direction }</td>
										<td>${leave.startTime }</td>
										<td>${leave.endTime }</td>
										<td>
											${leave.statusStr}
											<%-- <c:choose>
												<c:when test="${admins.status == '1' }">启用</c:when>
												<c:when test="${admins.status == '0' }">禁用</c:when>
											</c:choose> --%>
										</td>
										<td>
											<a class="btn btn-primary" href="${rootpath }/back/user/leaveUpdate.htm?aid=${leave.id}">修改</a>
											<a class="btn btn-primary" href="${rootpath }/back/user/leaveDelete.htm?aid=${leave.id}" onclick="return confirm('确认删除吗?')">删除</a>
										</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
	
						<form id="usersListPageForm"
							action="${rootpath }/back/user/leaveList.htm" method="post">
	
							<!-- 设置一些参数 -->
							<input type="hidden" name="keyword" value="${requestScope.keyword }">
							<input type="hidden" name="status" value="${requestScope.status }">
							<input type="hidden" name="st" value="${requestScope.st }">
							<input type="hidden" name="ed" value="${requestScope.ed }">
							
							<nav>
								<ul class="pager">
									<li><a href="#" onclick="return pageForm('usersListPageForm','currentPage','1','pageSize','${requestScope.pageInfoUtil.pageSize}');"><span>首页</span></a></li>
									<li><a href="#"
										onclick="return pageForm('usersListPageForm','currentPage','${requestScope.pageInfoUtil.prePage}','pageSize','${requestScope.pageInfoUtil.pageSize}');"><span>上一页</span></a></li>
									<li><a href="#"
										onclick="return pageForm('usersListPageForm','currentPage','${requestScope.pageInfoUtil.nextPage}','pageSize','${requestScope.pageInfoUtil.pageSize}');"><span>下一页</span></a></li>
									<li><a href="#"
										onclick="return pageForm('usersListPageForm','currentPage','${requestScope.pageInfoUtil.totalPage}','pageSize','${requestScope.pageInfoUtil.pageSize}');"><span>尾页</span></a></li>
									<li>共${requestScope.pageInfoUtil.totalPage }页,共${requestScope.pageInfoUtil.totalRecord }条</li>
									<li>
										第<input type="text" id="currentPage" name="currentPage"
											value="${requestScope.pageInfoUtil.currentPage }" size="5" maxlength="5" />页
									</li>
									<li>
										每页<input type="text" id="pageSize" name="pageSize"
										value="${requestScope.pageInfoUtil.pageSize }" size="5" maxlength="5" />条
									</li>
									<li><input type="submit" value="GO" class="btn btn-primary" /></li>
								</ul>
							</nav>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!-- 提示信息 -->
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1"></div>
		</div>
	
		<%@ include file="/common/include/footer.jsp"%>
	</body>
</html>